﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Alos.Common;
using Alos.Entity;
using Alos.IService;
using System.Threading.Tasks;

namespace Alos.LanClass.Api
{
    /// <summary>
    /// 用户指标获取
    /// </summary>
    public class AssessmentCriteriaController : ApiController
    {
        IAssessmentCriteriaService AssessmentCriteriaService;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="_AssessmentCriteriaService"></param>
        public AssessmentCriteriaController(IAssessmentCriteriaService _AssessmentCriteriaService)
        {
            AssessmentCriteriaService = _AssessmentCriteriaService;
        }
        /// <summary>
        /// 获取当前老师的用户指标
        /// </summary>
        /// <returns>用户指标</returns>
        [HttpGet]
        [Route("api/AssessmentCriteria/getAssessmentCriteria")]
        public async Task<JsonRtn<List<dynamic>>> getAssessmentCriteria(int Type)
        {
            var jsRtn = new JsonRtn<List<dynamic>>();
            jsRtn.data = await Task.Factory.StartNew(uid =>
            {
                return AssessmentCriteriaService.GetAssessmentCriteriaByTeacherId((int)uid, Type).ToList();
            }, Common.Current.User.id);
            return jsRtn;
        }
    }
}
